import styles from './muniuren.less';
import { Flex, WhiteSpace, List } from 'antd-mobile';
import { connect } from 'dva';
import router from 'umi/router'
import classnames from 'classnames';
import {Component} from 'react'
class Muniuren extends Component {
  componentDidMount(){
    this.props.dispatch({
      type: 'wallet/getUserNiubiEff'
    })
  }
  render(){
    return (
      <div className={styles.container}>
        {/* <WhiteSpace />
        <Flex className={styles.header}>
        <div className={styles.headerRight} onClick={()=> {router.push('/wallet')}}>
            <div className={styles.headerRightIconWrap}>
              <div className={styles.headerRightIcon}>
                <img className={styles.dataIcon} src={require('src/assets/我的收益-账户明细.png')} />
<<<<<<< HEAD
=======
                <img className={styles.dataIcon} src={require('src/assets/数据.png')} />
>>>>>>> 732a740e1bbe8886770bcd9129d4299e38428766
              </div>
              <span>查看我的钱包</span>
            </div>
          </div>
          <div className={styles.headerLeft}>
            <Flex style={{ height: '100%', width: '100% ' }} direction="column">
              {this.props.muniuren.headerData.map(item => (
                <Flex.Item className={styles.headerLeftMenu} key={item.text}>
                  <Flex style={{ height: '100%' }}>
                    <Flex.Item
                      className={`${styles.headerLeftMenuItem} ${styles.headerLeftMenuItemFirst}`}
                    >
                      {item.text}
                    </Flex.Item>
                    <Flex.Item className={styles.headerLeftMenuItem}>{item.data}</Flex.Item>
                  </Flex>
                </Flex.Item>
              ))}
            </Flex>
          </div>

        </Flex>
        <WhiteSpace size="lg" /> */}
        {/* <Flex className={styles.secondDiv}>
          {this.props.muniuren.secondDivData.map(item => (
            <Flex.Item className={styles.secondDivMenuItem} key={item.text}>
              <img className={styles.secondDivMenuIcon} src={item.iconSrc} alt="icon" />
              <span>{item.text}</span>
            </Flex.Item>
          ))}
        </Flex>
        <WhiteSpace size="lg" /> */}

        {this.props.muniuren.listData.map((list, listIndex) => (
          <div key={listIndex} className={styles.menuItem}>
            <List>
              {list.map(menu => (
                <List.Item
                  thumb={<img className={styles.menuItemImg} src={menu.iconSrc}/>}
                  arrow="horizontal"
                  key={menu.text}
                  onClick={() => {
                    router.push(menu.url);
                  }}
                >
                  {menu.text}
                </List.Item>
              ))}
            </List>
            <WhiteSpace size="lg" />
          </div>
        ))}
      </div>
    );
  }
}
export default connect(state => {
  return {
    muniuren: state.muniuren
  };
})(Muniuren);
